<?php

/**
 * BbPlayerStat form base class.
 *
 * @method BbPlayerStat getObject() Returns the current form's model object
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseBbPlayerStatForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'     => new sfWidgetFormInputHidden(),
      'p_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbPlayers'), 'add_empty' => false)),
      'm_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('BbMatch'), 'add_empty' => false)),
      'fgm'    => new sfWidgetFormInputText(),
      'fga'    => new sfWidgetFormInputText(),
      'pt3m'   => new sfWidgetFormInputText(),
      'pt3a'   => new sfWidgetFormInputText(),
      'ftm'    => new sfWidgetFormInputText(),
      'fta'    => new sfWidgetFormInputText(),
      'offreb' => new sfWidgetFormInputText(),
      'reb'    => new sfWidgetFormInputText(),
      'ast'    => new sfWidgetFormInputText(),
      'tov'    => new sfWidgetFormInputText(),
      'stl'    => new sfWidgetFormInputText(),
      'blk'    => new sfWidgetFormInputText(),
      'pf'     => new sfWidgetFormInputText(),
      'pts'    => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'     => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'p_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BbPlayers'))),
      'm_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('BbMatch'))),
      'fgm'    => new sfValidatorInteger(array('required' => false)),
      'fga'    => new sfValidatorInteger(array('required' => false)),
      'pt3m'   => new sfValidatorInteger(array('required' => false)),
      'pt3a'   => new sfValidatorInteger(array('required' => false)),
      'ftm'    => new sfValidatorInteger(array('required' => false)),
      'fta'    => new sfValidatorInteger(array('required' => false)),
      'offreb' => new sfValidatorInteger(array('required' => false)),
      'reb'    => new sfValidatorInteger(array('required' => false)),
      'ast'    => new sfValidatorInteger(array('required' => false)),
      'tov'    => new sfValidatorInteger(array('required' => false)),
      'stl'    => new sfValidatorInteger(array('required' => false)),
      'blk'    => new sfValidatorInteger(array('required' => false)),
      'pf'     => new sfValidatorInteger(array('required' => false)),
      'pts'    => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('bb_player_stat[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'BbPlayerStat';
  }

}
